<?xml version="1.0" encoding="UTF-8"?>
<%@ page contentType="application/x-blueprint+xml;charset=UTF-8" language="java" %>

<%@ page import="com.vhly.bpplat.twitter.HTTPClient" %>

<page xmlns:xsd="http://mobile.yahoo.com/widgets/schema/1.5/blueprint/">
    <content>
        <module>
            <header layout="simple">
                <layout-items>
                    <block>RT</block>
                </layout-items>
            </header>
            <%
                String login = (String) session.getAttribute("login");
                if (login != null) {
                    String user = (String) session.getAttribute("user");
                    String pass = (String) session.getAttribute("pass");
                    String tid = request.getParameter("tid");
                    String ftl = "http://twitter.com/statuses/retweet/" + tid + ".xml";
                    String acc = user + ":" + pass;
                    String xml = HTTPClient.request(ftl, acc, null, true);
                    if (xml != null) {
            %>
            <block>RT Tweet OK</block>
            <%
            } else {

            %>
            <block>RT Tweet Error</block>
            <%

                }
            } else {%>
            <block>Need Login</block>
            <% } %>
        </module>
    </content>

</page>
